﻿aux_source_directory(. EXAMPLE_SRC_LIST)
foreach(EXAMPLE_SRC ${EXAMPLE_SRC_LIST})
    STRING(REGEX REPLACE "^\\./|\\.c[a-zA-Z0-9_]*$" "" EXAMPLE_EXE_NAME ${EXAMPLE_SRC})
    message(STATUS "添加用例程序:${EXAMPLE_EXE_NAME}")
    add_executable(${EXAMPLE_EXE_NAME} ${EXAMPLE_SRC})

    if(ANDROID)
        target_link_libraries(${EXAMPLE_EXE_NAME} ${CMAKE_PROJECT_NAME}_static ${LINK_LIB_LIST})
    elseif(WIN32)
        target_link_libraries(${EXAMPLE_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST})
    else()
        target_link_libraries(${EXAMPLE_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST} pthread)
    endif()

endforeach(EXAMPLE_SRC ${EXAMPLE_SRC_LIST})
